package com.zlzxm.shoesmarket.view.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.zlzxm.shoesmarket.R;
import com.zlzxm.shoesmarket.view.adapter.entity.EntitySizeInfo;

import org.jetbrains.annotations.NotNull;

/**
 * CREATE BY zlzxm ON 4/15/21
 */
public class ADGoodsSize extends BaseQuickAdapter<EntitySizeInfo, BaseViewHolder> {
    public ADGoodsSize() {
        super(R.layout.item_goods_detail_size);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, EntitySizeInfo entity) {

        holder.setText(R.id.tvSize,entity.getSize());
        holder.setText(R.id.tvSave,entity.getSave());
        holder.setText(R.id.tvAvgPrice,entity.getAvgPrice());
        holder.setText(R.id.rvRate,entity.getProfitRate());


        if(holder.getAdapterPosition() == getData().size()- 1){

            holder.setVisible(R.id.line,false);
        }else {
            holder.setVisible(R.id.line,true);
        }
    }
}
